#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<string.h>
#include<ctype.h>
int main() {
    char arr1[10001] = { 0 };
    char* arr2[10001] = { 0 };
    int i = 0; int number = 0;
    gets(arr1);
    int len = strlen(arr1);
    for (i = 0; i < len; i++)
    {
        if (isalpha(arr1[i]))
        {
            arr2[number++] = &arr1[i];
        }
        while (isalpha(arr1[i]))
        {
            i++;
        }
        if(!isalpha(arr1[i])&&arr1[i]!='\0')
        {
            arr1[i] = '\0';
        }
    }
    number -= 1;
        for(i=number;0<=i;i--)
        {
            printf("%s ", arr2[i]);
        }
}